import Layout from '@/layout'

export const constantRoutes = [
  {
    path: '/login',
    name: 'login',
    meta: { isAuth: false },
    component: () => import('@/views/login/index')
  },
  {
    path: '/404',
    component: () => import('@/components/error-page/404'),
    hidden: true
  },
  {
    path: '/403',
    component: () => import('@/components/error-page/403'),
    hidden: true
  },
  {
    path: '/500',
    component: () => import('@/components/error-page/500'),
    hidden: true
  },
  {
    path: '/',
    name: '首页',
    redirect: '/actuation'
  }
]

export const asyncRoutes = [
  {
    path: '/actuation',
    component: Layout,
    meta: { icon: 'actuation', title: '执行站' },
    redirect: '/actuation/index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/actuation/home.vue'),
        meta: { title: '项目执行' }
      }, {
        path: 'begin',
        name: 'index',
        component: () => import('@/views/actuation/begin.vue'),
        meta: { title: '开执行单', hidden: true }
      }, {
        path: 'appoint',
        name: 'appoint',
        component: () => import('@/views/member/appoint.vue'),
        meta: { title: '预约服务' }
      }
    ]
  },
  {
    path: '/member',
    component: Layout,
    meta: { icon: 'huiyuanguanli', title: '会员管理' },
    redirect: '/member/archives',
    children: [
      {
        path: 'archives',
        name: 'archives',
        component: () => import('@/views/member/archives.vue'),
        meta: { title: '会员档案' }
      }, {
        path: 'deposit',
        name: 'deposit',
        component: () => import('@/views/member/deposit.vue'),
        meta: { title: '充值记录' }
      }, {
        path: 'consume',
        name: 'consume',
        component: () => import('@/views/member/consume.vue'),
        meta: { title: '购买记录' }
      }, {
        path: 'memberLevel',
        name: 'memberLevel',
        component: () => import('@/views/member/card.vue'),
        meta: { title: '会员卡' }
      }
    ]
  }, {
    path: '/actuation',
    component: Layout,
    meta: { icon: 'feiyong', title: '收费发药' },
    redirect: '/actuation/index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/actuation/home.vue'),
        meta: { title: '项目执行' }
      }, {
        path: 'begin',
        name: 'index',
        component: () => import('@/views/actuation/begin.vue'),
        meta: { title: '开执行单', hidden: true }
      }, {
        path: 'appoint',
        name: 'appoint',
        component: () => import('@/views/member/appoint.vue'),
        meta: { title: '预约服务' }
      }
    ]
  },
  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', name: '404', meta: { hidden: true } }
]
